//
//  ZBQuestionPopview.m
//  YouHui
//
//  Created by  on 11-12-7.
//  Copyright (c) 2011年 netease. All rights reserved.
//

#import "ZBAlertView.h"
#import "ZBPopViewContainer.h"

@implementation ZBAlertView

@synthesize messageLabel=_messageLabel;

-(id)initWithTitle:(NSString*)title message:(NSString *)message delegate:(id)delegate buttons:(NSString*)buttonTitle,...{
    va_list otherTitles;
    va_start(otherTitles, buttonTitle); 
    self = [super initWithTitle:title delegate:delegate button:buttonTitle otherButtons:otherTitles];
    va_end(otherTitles);
    if (self) {
         _messageLabel =[[UILabel alloc] initWithFrame:CGRectZero];
        _messageLabel.numberOfLines = 0;
        _messageLabel.backgroundColor =[UIColor clearColor];
        _messageLabel.text = message;
        _messageLabel.font = [UIFont boldSystemFontOfSize:14.0];     
     }
    return self;
}

-(void)dealloc {
    [_messageLabel release];
    [super dealloc];
}

-(void)show {
    if (!self.contentView) {
        ZBAlertViewContainer *content = [[[ZBAlertViewContainer alloc] initWithFrame:CGRectZero] autorelease];
        content.parentPopView = self;
        [content addElements];
        [content setNeedsLayout];
        self.contentView = content;        
    }
    [super show];
}

@end
